The TReply Structure
You use theTReply
structure to specify the data being sent with theOTSndReply
function (page 3-141) and the data being read with theOTRcvReply
function (page 3-144). You pass this structure as a parameter to each of these functions.The
TReply
structure is defined by theTReply
data type.
struct TReply { TNetbuf data; TNetbuf opt; OTSequence sequence; }; typedef struct TReply TReply;
Field Description
data
- A
TNetbuf
structure specifying the location and size of the reply buffer.- In the
reply
parameter to theOTSndRepl
y function, this field specifies the location and size of a buffer containing the reply data. You must allocate and initialize a buffer that contains the data and set thedata.buf
field to point to it. You must set thedata.len
field to the size of the reply data. The size of the reply must not exceed the value specified for thetsdu
field of theTEndpointInfo
structure for this endpoint.- In the
reply
parameter to theOTRcvReply
function, on return, this field specifies the size and location of a buffer into which the function places the data to be read. You must allocate a buffer for this data, set thedata.buf
field to point to it, and set thedata.maxlen
field to the maximum size of the buffer. This value must not exceed the value specified for thetsdu
field of theTEndpointInfo
structure for this endpoint.- If you are doing a no-copy receive, the
data.buf
field is a pointer to anOTBuffer
pointer. In this case, you must set thedata.maxlen
field to the constantkNetbufDataIsOTBufferStar
.opt
- A
TNetbuf
structure describing the size and location of an option buffer.- In the
reply
parameter to theOTSndRepl
y function, this field specifies the location and size of a buffer containing the options you want to set. You must allocate a buffer for the option values, set theopt.buf
field to point to it, and set theopt.len
field to the length of the options or to 0 if don't want to specify any options.- In the
reply
parameter to theOTRcvRepl
y function, on return, this field specifies the location and size of a buffer containing the association-related options sent with theOTSndReply
function. You must allocate a buffer for the option information, set theopt.buf
field to point to it, and set theopt.maxlen
field to the maximum size of the buffer.sequence
- A long that specifies the transaction ID of the current transaction.
- When sending a reply, you set this field to the value that you read with the
OTRcvURequest
function for this field.- When receiving a reply, if you have sent out multiple requests, you use this field to match incoming replies to outgoing requests.